package com.googlecode.c4e.ui.views.internal;

import org.eclipse.core.runtime.jobs.ISchedulingRule;

import com.googlecode.c4e.api.model.ProjectGroup;

public class ProjectGroupAdapterSchedulingRule implements ISchedulingRule {

	private ProjectGroup projectGroup;

	ProjectGroupAdapterSchedulingRule(ProjectGroup projectGroup) {
		this.projectGroup = projectGroup;
	}

	public boolean contains(ISchedulingRule rule) {
		if (rule instanceof ProjectGroupAdapterSchedulingRule) {
			return ((ProjectGroupAdapterSchedulingRule) rule).projectGroup
					.equals(projectGroup);
		}
		return false;
	}

	public boolean isConflicting(ISchedulingRule rule) {
		return contains(rule);
	}

}
